#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2018 crane <crane@his-pc>
#
# Distributed under terms of the MIT license.

"""

"""


class Solution:
    '''
    只使用递归和10, 不使用指数计数等
    '''
    def reverseInteger(self, number):
        return self.reverse(number, 0)

    def reverse(self, number, pre):
        if number == 0:
            return pre

        large = number // 10
        little = number % 10

        return self.reverse(large, pre * 10 + little)


def main():
    print("start main")
    s = Solution()
    # ret = s.reverseInteger(123)
    ret = s.reverseInteger(200)
    print(ret)

if __name__ == "__main__":
    main()
